//package com.swjd.config;
//
//import com.swjd.servletComponent.MyFilter;
//import com.swjd.servletComponent.MyListener;
//import com.swjd.servletComponent.MyServlet;
//import org.springframework.boot.web.servlet.FilterRegistrationBean;
//import org.springframework.boot.web.servlet.ServletListenerRegistrationBean;
//import org.springframework.boot.web.servlet.ServletRegistrationBean;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
//import java.util.Arrays;
//
////配置类注解
//@Configuration
//public class servletConfig {
//    /*
//    servlet组件的注册
//     */
//    @Bean
//    public ServletRegistrationBean getServlet(MyServlet myServlet){
//        ServletRegistrationBean<MyServlet> myServletServletRegistrationBean = new ServletRegistrationBean<>(myServlet, "/myServlet");
//        return myServletServletRegistrationBean;
//    }
//    /*
//    Filter组件注册
//     */
//    @Bean
//    public FilterRegistrationBean getFilter(MyFilter myFilter){
//        FilterRegistrationBean<MyFilter> myFilterFilterRegistrationBean = new FilterRegistrationBean<>(myFilter);
//        myFilterFilterRegistrationBean.setUrlPatterns(Arrays.asList("/toLoginPage"));
//        return myFilterFilterRegistrationBean;
//    }
//    /*
//    Listener组件注册
//     */
//    @Bean
//    public ServletListenerRegistrationBean getListener(MyListener myListener){
//        ServletListenerRegistrationBean<MyListener> myListenerServletListenerRegistrationBean = new ServletListenerRegistrationBean<>(myListener);
//        return myListenerServletListenerRegistrationBean;
//    }
//
//}
